﻿CREATE FUNCTION [dbo].[NextRequestStatusesByID]
(@TrackerRequestID int,@Direction int = 0)
RETURNS TABLE
AS
RETURN(
SELECT s.* FROM (SELECT StatusID FROM t_TrackerRequest WHERE ID = @TrackerRequestID) tr CROSS APPLY NextMenus(StatusID,@Direction) s
)

